<?php
?>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-latest.js"></script>
 <script src="js/bootstrap.min.js"></script>
<script>
function validateForm()
{
	var x=document.forms["form1"]["myusername"].value;
	var match = /^\w+[@]hawaii[.]edu$/.test(x);
	if (match == false)
	{
	  alert("Username must be a valid hawaii.edu email address");
	  return false;
	}
	var y=document.forms["form1"]["mypassword"].value; 
	var match2 = /^[\w!"#$%&'()[\]*+,-./:;<=>?@\\^`{\|}~]{8,12}$/.test(y);
	if (match2 == false)
	{
	  alert("Password must be between 8 and 12 characters in length.");
	  return false;
	}	
	var z=document.forms["form1"]["mypasswordrepeat"].value; 
	if (y != z)
	{
	  alert("Passwords do not match.");
	  return false;
	}
}
</script>
</head>
<body>
<table width="600" border="0" align="middle" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" onsubmit="return validateForm()" action="mailing.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><label><strong>Account Registration</strong></label></td>
</tr>
<tr>
<td width="150"><label>Email Address:</label></td>
<td width="10">:</td>
<td width="200"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td><label>Password(8-12 characters)</label></td>
<td>:</td>
<td><input name="mypassword" type="password" id="mypassword"></td>
</tr>
<td><label>Repeat Password</label></td>
<td>:</td>
<td><input name="mypasswordrepeat" type="password" id="mypasswordrepeat"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" name="Submit" value="Register" class="btn btn-mini btn-block btn-primary"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</body>
</html>